//JavaScript代码区域
layui.use(['table'], function(){
    loadData();
});

function loadData() {
    layui.table.render({
        elem: '#tableData'
        , toolbar: '#toolbarDemo'
        , height: 'full-300'
        , url: '/demo/table/user/' //数据接口
        , page: true //开启分页
        , cols: [[ //表头
            {field: 'name', title: '姓名', width: 80, fixed: 'left'}
            , {field: 'leavedate', title: '离职日期', width: 200}
            , {field: 'leavereason', title: '离职原因', width: 200}
            , {field: 'employeenumber', title: '工号', width: 130}
            , {field: 'dept', title: '部门', width: 130}
            , {field: 'position', title: '职位', width: 130}
            , {field: 'employeetype', title: '员工类型', width: 130}
            , {field: 'hiredate', title: '入职时间', width: 130}
            , {field: 'mobilephone', title: '手机号码', width: 130}
            , {field: 'do', title: '操作', width: 130}
        ]]
    });
}